<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ include file="/commons/pages/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<s:if test="#session.management.userRole!=7">
<div class="subtitle">
  <h3>项目信息管理</h3>
</div>
<s:form action="BaseProjectInfo!list.action" method="post" id="query_form">
  <input type="hidden" name="selectBean.isAll" value="0" id="sb_isall"/>
  <table width="100%" border="0" cellpadding="5" cellspacing="0" class="subtbl">
    <tr>
      <td>项目编号：
        <input name="selectBean.proj_code" type="text" class="webinput" size="20" value="<s:property value='selectBean.proj_code'/>"/>		  </td>
      <td>项目名称：
        <input name="selectBean.proj_name" type="text" class="webinput" size="20" value="<s:property value='selectBean.proj_name'/>"/></td>
    </tr>
    <tr>
      <td>项目所属城市：
      	 <select id="prov_index" type="text" dataType="Require" msg="请选择" onChange="initCity(this.value, 'city_index');"></select>
      <select id="city_index" name="selectBean.p_index" dataType="Require" msg="请选择"></select>
      	</td>
      <td>项目时间：
        <input name="selectBean.proj_date" type="text" class="webinput" size="20" value="<s:date name='selectBean.proj_date' format="yyyy-MM-dd"/>" onclick="fPopCalendar(this);" readonly="readonly"/></td>
    </tr>
    <tr>
      <td><input name="button2" type="submit" class="websub" id="button2" value="查 询" />
        <input name="button_query_all" type="button" class="websub"  id="button3" value="查询全部" onclick="javascript:queryAll()"/></td>
    </tr>
  </table>
  <table width="100%" border="0" cellpadding="5" cellspacing="1" class="tbl_list">
  	<s:if test="#session.management.userRole==1 || #session.management.userRole==3">
		    <tr>
		      <td align="right" colspan="7"><input name="button2" type="button" class="websub" onclick="location.href='BaseProjectInfo!add.action'" value="添加" /></td>
		    </tr>
   		</s:if>
    <tr>
      <th width="7%">序号</th>
      <th width="15%">项目编号</th>
      <th width="30%">项目名称</th>
      <th width="14%">所属城市</th>
      <th width="9%">工程阶段</th>
      <th width="12%">项目时间</th>
      <th width="13%">操作</th>
    </tr>
    <s:iterator value="list" var="cur" status="vs">
      <tr align="center">
        <td><abean:counter write="true" /></td>
        <td><s:property value="#cur.PROJ_CODE"/></td>
        <td><s:property value="#cur.PROJ_NAME"/></td>
        <td><s:property value="#cur.PROV_NAME"/> <s:property value="#cur.P_NAME"/></td>
        <td>
        	<s:if test="#cur.PHRASE==1">方案</s:if>
	     	<s:if test="#cur.PHRASE==2">施工</s:if>
	     	<s:if test="#cur.PHRASE==3">服务</s:if>
        </td>
        <td><s:date name="#cur.PROJ_DATE" format="yyyy-MM-dd"/></td>
        <td>
        	<a href="BaseProjectInfo!view.action?id=<s:property value='#cur.ID'/>">查看 </a> 
        	<s:if test="#session.management.userRole==1 || #session.management.userRole==3">
        		<a href="BaseProjectInfo!edit.action?id=<s:property value='#cur.ID'/>">修改</a> 
        		<a href="javascript:if(confirm('您确定要删除吗？')){location.href='BaseProjectInfo!delete.action?id=<s:property value='#cur.ID'/>';}">删除</a>
        	</s:if>
        </td>
      </tr>
    </s:iterator>
    <abean:tablefill name="BaseProjectInfo" property="selectBean.pager" column="7"/>
  </table>
  <div id="showpage">
    <ahtml:pagination name="BaseProjectInfo" method="list" showsize="false" property="selectBean.pager"/>
  </div>
</s:form>
<script src='/dwr/interface/BaseDataService.js'></script>
<script src='/dwr/engine.js'></script>
<script src='/dwr/util.js'></script>
<script src='/commons/scripts/validator.js'></script> 
<script type="text/javascript">
$j(document).ready(function(){
	var city = '<s:property value="selectBean.p_index"/>';
	var prov = '';
	if(city!=''){
		prov = city.substr(0,2)+"0000";
	}
	initCity('0','prov_index',prov,'city_index',city);
	
});
function queryAll(){
	document.getElementById('sb_isall').value=1;
	document.forms["query_form"].submit();
}
</script>
</s:if>
</body>
</html>
